using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;

namespace ERP.Reports
{
    public partial class rptDoanhthuBanhang : DevExpress.XtraReports.UI.XtraReport
    {
        public DataTable ds_BaoCao = null;
        //public DataTable dsHoadon = null;
        public string sTungay = "";
        public string sKhuvuc = "";
        public string sDonvi = "";
        public string sDiachi = "";

        public rptDoanhthuBanhang()
        {
            InitializeComponent();
        }

        public void In()
        {
            this.ganNhan();
            this.InBaoCao(this.ds_BaoCao);
        }

        private void ganNhan()
        {
            this.lbKhuvuc.Text = this.sKhuvuc;
            this.lbTungay.Text = this.sTungay;
            this.lbDonvi.Text = this.sDonvi;
            this.lbDiachi.Text = this.sDiachi;
        }

        private void InBaoCao(DataTable dsReport)
        {

            this.DataSource = dsReport;

            this.txtStt.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"stt")});

            this.txtBan.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"tenkhachhang")});

            this.txtNgayban.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"ngayban")});

            this.txtTongtien.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"conlai", "{0:#,#}")});

            this.txtThanhtoan.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"datra", "{0:#,#}")});

            this.txtConno.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"conno","{0:#,#}")});


        }

        private void rptDoanhthuBanhang_DesignerLoaded(object sender, DevExpress.XtraReports.UserDesigner.DesignerLoadedEventArgs e)
        {
            //this.In();
        }
    }
}
